1. Technical Field
The present invention relates generally to an improved data processing system. In particular, the present invention is directed to a method, apparatus, and computer instructions for handling system reset exceptions (SREs).
2. Description of Related Art
In a PowerPC processor, translation of virtual addresses to physical addresses may be performed using a Memory Management Unit (MMU). PowerPC processor is a product of Motorola, Inc. or IBM Corporation. The MMU utilizes page tables comprised of multiple entries called page-table entries (PTEs) to facilitate translation of virtual memory into real memory. When a process requests a system resource by presenting an address, the MMU automatically scans the page table for a matching page table entry. When a match is found, the virtual memory is translated to physical memory for use by the process.
Page table entries are used to store physical page numbers and other defining information for corresponding virtual addresses. A physical page number and a page offset are combined to form a complete physical address. The page table entry has bit-fields which include attribute information, such as if the page has been written to, when it was last used, and what kind of processes may read and write to it. The page table entry may also have specific bits reserved for software to implement a software locking mechanism to establish exclusive ownership of the page table entry for entry-update serialization.
A problem with using such a locking mechanism arises when a process has acquired the ownership of a PTE and a non-maskable system reset exception (SRE) occurs. An SRE is similar to a virtual pressing of the “reset” button on a computer. If an SRE occurs when a process has acquired a PTE but not yet released the ownership, the software lock obtained by the processor will be held indefinitely and become a deadlock. That is, even though the processor has received the SRE, the page table entry will still indicate that the processor has a lock on a shared resource if the resource call is prematurely ended. Since the resource call cannot be completed, the lock will never be released. This situation causes a problem in that other processes or threads will not be able to obtain access to system resources locked by the processor. These other processes will become “starved” by continuing to try to obtain a lock on the system resources, i.e. spinning on the lock, and never being able to perform the necessary work requiring the lock on the system resource.
Without knowing the specific page table entry that is locked, software in some systems must rely on the brute-force method to search the page table for the locked page table entry and release it. An example of such as system is the JS20 Blade Server, a product of IBM Corporation. As the page table may be very large in size, the brute-force method may result in a time-extensive search just to find that one locked page table entry.
Therefore, it would be advantageous to have an improved method, apparatus, and computer instructions for avoiding deadlocks due to non-maskable system reset exceptions.